<%-- 
    Document   : register
    Created on : Oct 17, 2011, 10:55:52 PM
    Author     : NGUYEN CONG BINH
--%>

<%@page import="DAO.DonDatHangDAO"%>
<%@page import="POJO.DonDatHangPOJO"%>
<%@page import="java.util.ArrayList"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<body>
    <link type="text/css" rel="stylesheet" media="screen" href="CSS/layout.css">
    <link type="text/css" rel="stylesheet" media="screen" href="CSS/layout_v2.1.0.8.css">
    <div id="wrapper">  	  	
        <div id="content">
            <div class="breadcrumb">
                <span><img height="12" width="12" alt="Trang chủ" src="Images/Images_css_files/icon_link.gif"><a href="#">Trang chủ</a></span><span>Hóa đơn mua hàng</span>
            </div>
            <div class="clear"></div>
            <div class="other_content">
                <div class="top_other_content">
                    <div class="ltop_other_content"></div>
                    <div class="rtop_other_content"></div>	
                </div>
                <form action="LoginController" method="get" name="frm" id="frm">

                    <div class="login">
                        <div align ="center">
                            <!-- -->   


                            <%
                                ArrayList<DonDatHangPOJO> donhang = (ArrayList<DonDatHangPOJO>) request.getAttribute("danhsachdondathangAttribute");
                                String error = "";
                                if (request.getAttribute("Error") != null) {
                                    error = (String) request.getAttribute("Error");
                                }
                            %>

                          
                            <table width="700" height="152" border="0" align="center" cellpadding="0" cellspacing="0">
                                <tr>
                                    <td>&nbsp;</td>
                                    <td height="89" colspan="4" class="title_order" > <em><strong>Đơn đặt hàng:</strong></em></td>
                                </tr>
                                <tr class="title_order">
                                    <td width="30" height="48">Xóa</td>
                                    <td width="90">Mã hóa đơn</td>
                                    <td width="120">Ngày lập hóa đơn</td>
                                    <td width="120">Số lượng sản phẩm</td>
                                    <td width="100">Tổng tiền</td>
                                </tr>
                                <%
                                    for (int i = 0; i < donhang.size(); i++) {
                                        DonDatHangPOJO dh = donhang.get(i);
                                        ArrayList<Object> sltt = DonDatHangDAO.laySoLuongVaTongTien(dh.getMaDonDatHang());
                                %>
                                <tr>
                                    <td><a href="InvoiceController?Action=Delete&MaDonDatHang=<%= dh.getMaDonDatHang()%> "><img  alt="delete" src="Images/Images_css_files/delete_bt.gif"></a></td>
                                    <td><a href="InvoiceDetailController?Action=View"><%= dh.getMaDonDatHang() %></a></td>
                                    
                                    <td><%= dh.getNgayDatHang()%></td>
                                    <td><%= sltt.get(0)%></td>
                                    <td><font color="#0000CC" face="Tahoma, Geneva, sans-serif"><strong><%= sltt.get(1)%>  </strong> </font>₫</td>
                                </tr>
                                <% }%>
                                <tr>
                                    <td>&nbsp;</td>
                                    <td height="89" colspan="4" class="title_order" > <strong><%= error%></strong></td>
                                </tr>
                            </table>


                            <div class="button_listing_input">
                                <a href="HomeController?Action=View" rel="nofollow">
                                    <input type="button" value="Trở về trang chủ" name="submit" >
                                </a>
                            </div>

                        </div>
                        <!-- -->      
                    </div>
                </form>
                <div class="bottom_other_content">
                    <div class="lbottom_other_content"></div>
                    <div class="rbottom_other_content"></div>
                </div>
            </div>
        </div>
    </div>
